<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Eigen: Eigen::SparseQR&lt; MatrixType_, OrderingType_ &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="eigendoxy.css" rel="stylesheet" type="text/css">
<!--  -->
<script type="text/javascript" src="eigen_navtree_hacks.js"></script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="Eigen_Silly_Professor_64x64.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname"><a href="http://eigen.tuxfamily.org">Eigen</a>
   &#160;<span id="projectnumber">3.4.90 (git rev 67eeba6e720c5745abc77ae6c92ce0a44aa7b7ae)</span>
   </div>
  </td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.svg"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classEigen_1_1SparseQR.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="classEigen_1_1SparseQR-members.html">List of all members</a> &#124;
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">Eigen::SparseQR&lt; MatrixType_, OrderingType_ &gt; Class Template Reference<div class="ingroups"><a class="el" href="group__Sparse__chapter.html">Sparse linear algebra</a> &raquo; <a class="el" href="group__Sparse__Reference.html">Reference</a> &raquo; <a class="el" href="group__SparseQR__Module.html">SparseQR module</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename MatrixType_, typename OrderingType_&gt;<br />
class Eigen::SparseQR&lt; MatrixType_, OrderingType_ &gt;</h3>

<p><a class="el" href="structEigen_1_1Sparse.html">Sparse</a> left-looking QR factorization with numerical column pivoting. </p>
<p>This class implements a left-looking QR decomposition of sparse matrices with numerical column pivoting. When a column has a norm less than a given tolerance it is implicitly permuted to the end. The QR factorization thus obtained is given by A*P = Q*R where R is upper triangular or trapezoidal.</p>
<p>P is the column permutation which is the product of the fill-reducing and the numerical permutations. Use <a class="el" href="classEigen_1_1SparseQR.html#aa27f024fe063684754047c531ab84a2b">colsPermutation()</a> to get it.</p>
<p>Q is the orthogonal matrix represented as products of Householder reflectors. Use <a class="el" href="classEigen_1_1SparseQR.html#aa3c7967f81ef047891a549a514908cd3">matrixQ()</a> to get an expression and <a class="el" href="classEigen_1_1SparseQR.html#aa3c7967f81ef047891a549a514908cd3">matrixQ()</a>.adjoint() to get the adjoint. You can then apply it to a vector.</p>
<p>R is the sparse triangular or trapezoidal matrix. The later occurs when A is rank-deficient. <a class="el" href="classEigen_1_1SparseQR.html#a7764a1f00c0d83f6423f81a4a40d5f8c">matrixR()</a>.topLeftCorner(<a class="el" href="classEigen_1_1SparseQR.html#afa0359921bffa067601b102edff440b0">rank()</a>, <a class="el" href="classEigen_1_1SparseQR.html#afa0359921bffa067601b102edff440b0">rank()</a>) always returns a triangular factor of full rank.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">MatrixType_</td><td>The type of the sparse matrix A, must be a column-major SparseMatrix&lt;&gt; </td></tr>
    <tr><td class="paramname">OrderingType_</td><td>The fill-reducing ordering method. See the <a class="el" href="group__OrderingMethods__Module.html">OrderingMethods </a> module for the list of built-in and external ordering methods.</td></tr>
  </table>
  </dd>
</dl>
<p>This class follows the <a class="el" href="group__TopicSparseSystems.html#TutorialSparseSolverConcept">sparse solver concept </a>.</p>
<p>The numerical pivoting strategy and default threshold are the same as in SuiteSparse QR, and detailed in the following paper: <em> Tim Davis, "Algorithm 915, SuiteSparseQR: Multifrontal Multithreaded Rank-Revealing <a class="el" href="structEigen_1_1Sparse.html">Sparse</a> QR Factorization, ACM Trans. on Math. Soft. 38(1), 2011. </em> Even though it is qualified as "rank-revealing", this strategy might fail for some rank deficient problems. When this class is used to solve linear or least-square problems it is thus strongly recommended to check the accuracy of the computed solution. If it failed, it usually helps to increase the threshold with setPivotThreshold.</p>
<dl class="section warning"><dt>Warning</dt><dd>The input sparse matrix A must be in compressed mode (see <a class="el" href="classEigen_1_1SparseMatrix.html#a6400e6e733a7131f9b776d6386d2ed89">SparseMatrix::makeCompressed()</a>). </dd>
<dd>
For complex matrices <a class="el" href="classEigen_1_1SparseQR.html#aa3c7967f81ef047891a549a514908cd3">matrixQ()</a>.transpose() will actually return the adjoint matrix. </dd></dl>
</div><div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for Eigen::SparseQR&lt; MatrixType_, OrderingType_ &gt;:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="classEigen_1_1SparseQR__inherit__graph.png" border="0" usemap="#aEigen_1_1SparseQR_3_01MatrixType___00_01OrderingType___01_4_inherit__map" alt="Inheritance graph"/></div>
<map name="aEigen_1_1SparseQR_3_01MatrixType___00_01OrderingType___01_4_inherit__map" id="aEigen_1_1SparseQR_3_01MatrixType___00_01OrderingType___01_4_inherit__map">
<area shape="rect" title="Sparse left&#45;looking QR factorization with numerical column pivoting." alt="" coords="5,248,205,633"/>
<area shape="rect" href="classEigen_1_1SparseSolverBase.html" title=" " alt="" coords="20,5,191,200"/>
</map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a4b425ddb1358c914d764cde48853a4f6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1SparseQR.html#a4b425ddb1358c914d764cde48853a4f6">analyzePattern</a> (const MatrixType &amp;mat)</td></tr>
<tr class="memdesc:a4b425ddb1358c914d764cde48853a4f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Preprocessing step of a QR factorization.  <a href="classEigen_1_1SparseQR.html#a4b425ddb1358c914d764cde48853a4f6">More...</a><br /></td></tr>
<tr class="separator:a4b425ddb1358c914d764cde48853a4f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6fdb992f3381ecc5b0a21a692fc0e0a4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1SparseQR.html#a6fdb992f3381ecc5b0a21a692fc0e0a4">cols</a> () const</td></tr>
<tr class="separator:a6fdb992f3381ecc5b0a21a692fc0e0a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa27f024fe063684754047c531ab84a2b"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classEigen_1_1PermutationMatrix.html">PermutationType</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1SparseQR.html#aa27f024fe063684754047c531ab84a2b">colsPermutation</a> () const</td></tr>
<tr class="separator:aa27f024fe063684754047c531ab84a2b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba8ae81fd3d4ce9139eccb6b7a0256b2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1SparseQR.html#aba8ae81fd3d4ce9139eccb6b7a0256b2">compute</a> (const MatrixType &amp;mat)</td></tr>
<tr class="separator:aba8ae81fd3d4ce9139eccb6b7a0256b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a55a34bacf05bd30a1dacbccad9f03c6d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1SparseQR.html#a55a34bacf05bd30a1dacbccad9f03c6d">factorize</a> (const MatrixType &amp;mat)</td></tr>
<tr class="memdesc:a55a34bacf05bd30a1dacbccad9f03c6d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs the numerical QR factorization of the input matrix.  <a href="classEigen_1_1SparseQR.html#a55a34bacf05bd30a1dacbccad9f03c6d">More...</a><br /></td></tr>
<tr class="separator:a55a34bacf05bd30a1dacbccad9f03c6d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae9da700b8c3b9bb30ff77508c359e764"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__enums.html#ga85fad7b87587764e5cf6b513a9e0ee5e">ComputationInfo</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1SparseQR.html#ae9da700b8c3b9bb30ff77508c359e764">info</a> () const</td></tr>
<tr class="memdesc:ae9da700b8c3b9bb30ff77508c359e764"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reports whether previous computation was successful.  <a href="classEigen_1_1SparseQR.html#ae9da700b8c3b9bb30ff77508c359e764">More...</a><br /></td></tr>
<tr class="separator:ae9da700b8c3b9bb30ff77508c359e764"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab9cc9c9d14e8c2f7587ca3f747bd1c14"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1SparseQR.html#ab9cc9c9d14e8c2f7587ca3f747bd1c14">lastErrorMessage</a> () const</td></tr>
<tr class="separator:ab9cc9c9d14e8c2f7587ca3f747bd1c14"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa3c7967f81ef047891a549a514908cd3"><td class="memItemLeft" align="right" valign="top">SparseQRMatrixQReturnType&lt; <a class="el" href="classEigen_1_1SparseQR.html">SparseQR</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1SparseQR.html#aa3c7967f81ef047891a549a514908cd3">matrixQ</a> () const</td></tr>
<tr class="separator:aa3c7967f81ef047891a549a514908cd3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7764a1f00c0d83f6423f81a4a40d5f8c"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classEigen_1_1SparseMatrix.html">QRMatrixType</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1SparseQR.html#a7764a1f00c0d83f6423f81a4a40d5f8c">matrixR</a> () const</td></tr>
<tr class="separator:a7764a1f00c0d83f6423f81a4a40d5f8c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afa0359921bffa067601b102edff440b0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1SparseQR.html#afa0359921bffa067601b102edff440b0">rank</a> () const</td></tr>
<tr class="separator:afa0359921bffa067601b102edff440b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9b196c075fdf32737b6843a615e79ea6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1SparseQR.html#a9b196c075fdf32737b6843a615e79ea6">rows</a> () const</td></tr>
<tr class="separator:a9b196c075fdf32737b6843a615e79ea6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a05f11a211307cb106e9e47ee9730d7ed"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1SparseQR.html#a05f11a211307cb106e9e47ee9730d7ed">setPivotThreshold</a> (const RealScalar &amp;threshold)</td></tr>
<tr class="separator:a05f11a211307cb106e9e47ee9730d7ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa77f5cb833bbea615adb532139761971"><td class="memTemplParams" colspan="2">template&lt;typename Rhs &gt; </td></tr>
<tr class="memitem:aa77f5cb833bbea615adb532139761971"><td class="memTemplItemLeft" align="right" valign="top">const <a class="el" href="classEigen_1_1Solve.html">Solve</a>&lt; <a class="el" href="classEigen_1_1SparseQR.html">SparseQR</a>, Rhs &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classEigen_1_1SparseQR.html#aa77f5cb833bbea615adb532139761971">solve</a> (const <a class="el" href="classEigen_1_1MatrixBase.html">MatrixBase</a>&lt; Rhs &gt; &amp;B) const</td></tr>
<tr class="separator:aa77f5cb833bbea615adb532139761971"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5f13e65437ada7e10a85de8cd55db11d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1SparseQR.html#a5f13e65437ada7e10a85de8cd55db11d">SparseQR</a> (const MatrixType &amp;mat)</td></tr>
<tr class="separator:a5f13e65437ada7e10a85de8cd55db11d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classEigen_1_1SparseSolverBase"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classEigen_1_1SparseSolverBase')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classEigen_1_1SparseSolverBase.html">Eigen::SparseSolverBase&lt; SparseQR&lt; MatrixType_, OrderingType_ &gt; &gt;</a></td></tr>
<tr class="memitem:a4a66e9498b06e3ec4ec36f06b26d4e8f inherit pub_methods_classEigen_1_1SparseSolverBase"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classEigen_1_1Solve.html">Solve</a>&lt; <a class="el" href="classEigen_1_1SparseQR.html">SparseQR</a>&lt; MatrixType_, OrderingType_ &gt;, Rhs &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1SparseSolverBase.html#a4a66e9498b06e3ec4ec36f06b26d4e8f">solve</a> (const <a class="el" href="classEigen_1_1MatrixBase.html">MatrixBase</a>&lt; Rhs &gt; &amp;b) const</td></tr>
<tr class="separator:a4a66e9498b06e3ec4ec36f06b26d4e8f inherit pub_methods_classEigen_1_1SparseSolverBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3a8d97173b6e2630f484589b3471cfc7 inherit pub_methods_classEigen_1_1SparseSolverBase"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classEigen_1_1Solve.html">Solve</a>&lt; <a class="el" href="classEigen_1_1SparseQR.html">SparseQR</a>&lt; MatrixType_, OrderingType_ &gt;, Rhs &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1SparseSolverBase.html#a3a8d97173b6e2630f484589b3471cfc7">solve</a> (const <a class="el" href="classEigen_1_1SparseMatrixBase.html">SparseMatrixBase</a>&lt; Rhs &gt; &amp;b) const</td></tr>
<tr class="separator:a3a8d97173b6e2630f484589b3471cfc7 inherit pub_methods_classEigen_1_1SparseSolverBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aacd99fa17db475e74d3834767f392f33 inherit pub_methods_classEigen_1_1SparseSolverBase"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1SparseSolverBase.html#aacd99fa17db475e74d3834767f392f33">SparseSolverBase</a> ()</td></tr>
<tr class="separator:aacd99fa17db475e74d3834767f392f33 inherit pub_methods_classEigen_1_1SparseSolverBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a5f13e65437ada7e10a85de8cd55db11d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5f13e65437ada7e10a85de8cd55db11d">&#9670;&nbsp;</a></span>SparseQR()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType_ , typename OrderingType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classEigen_1_1SparseQR.html">Eigen::SparseQR</a>&lt; MatrixType_, OrderingType_ &gt;::<a class="el" href="classEigen_1_1SparseQR.html">SparseQR</a> </td>
          <td>(</td>
          <td class="paramtype">const MatrixType &amp;&#160;</td>
          <td class="paramname"><em>mat</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Construct a QR factorization of the matrix <em>mat</em>.</p>
<dl class="section warning"><dt>Warning</dt><dd>The matrix <em>mat</em> must be in compressed mode (see <a class="el" href="classEigen_1_1SparseMatrix.html#a6400e6e733a7131f9b776d6386d2ed89">SparseMatrix::makeCompressed()</a>).</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classEigen_1_1SparseQR.html#aba8ae81fd3d4ce9139eccb6b7a0256b2">compute()</a> </dd></dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a4b425ddb1358c914d764cde48853a4f6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4b425ddb1358c914d764cde48853a4f6">&#9670;&nbsp;</a></span>analyzePattern()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType , typename OrderingType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classEigen_1_1SparseQR.html">Eigen::SparseQR</a>&lt; MatrixType, OrderingType &gt;::analyzePattern </td>
          <td>(</td>
          <td class="paramtype">const MatrixType &amp;&#160;</td>
          <td class="paramname"><em>mat</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Preprocessing step of a QR factorization. </p>
<dl class="section warning"><dt>Warning</dt><dd>The matrix <em>mat</em> must be in compressed mode (see <a class="el" href="classEigen_1_1SparseMatrix.html#a6400e6e733a7131f9b776d6386d2ed89">SparseMatrix::makeCompressed()</a>).</dd></dl>
<p>In this step, the fill-reducing permutation is computed and applied to the columns of A and the column elimination tree is computed as well. Only the sparsity pattern of <em>mat</em> is exploited.</p>
<dl class="section note"><dt>Note</dt><dd>In this step it is assumed that there is no empty row in the matrix <em>mat</em>. </dd></dl>

</div>
</div>
<a id="a6fdb992f3381ecc5b0a21a692fc0e0a4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6fdb992f3381ecc5b0a21a692fc0e0a4">&#9670;&nbsp;</a></span>cols()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType_ , typename OrderingType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> <a class="el" href="classEigen_1_1SparseQR.html">Eigen::SparseQR</a>&lt; MatrixType_, OrderingType_ &gt;::cols </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>the number of columns of the represented matrix. </dd></dl>

</div>
</div>
<a id="aa27f024fe063684754047c531ab84a2b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa27f024fe063684754047c531ab84a2b">&#9670;&nbsp;</a></span>colsPermutation()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType_ , typename OrderingType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classEigen_1_1PermutationMatrix.html">PermutationType</a>&amp; <a class="el" href="classEigen_1_1SparseQR.html">Eigen::SparseQR</a>&lt; MatrixType_, OrderingType_ &gt;::colsPermutation </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>a const reference to the column permutation P that was applied to A such that A*P = Q*R It is the combination of the fill-in reducing permutation and numerical column pivoting. </dd></dl>

</div>
</div>
<a id="aba8ae81fd3d4ce9139eccb6b7a0256b2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aba8ae81fd3d4ce9139eccb6b7a0256b2">&#9670;&nbsp;</a></span>compute()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType_ , typename OrderingType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classEigen_1_1SparseQR.html">Eigen::SparseQR</a>&lt; MatrixType_, OrderingType_ &gt;::compute </td>
          <td>(</td>
          <td class="paramtype">const MatrixType &amp;&#160;</td>
          <td class="paramname"><em>mat</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Computes the QR factorization of the sparse matrix <em>mat</em>.</p>
<dl class="section warning"><dt>Warning</dt><dd>The matrix <em>mat</em> must be in compressed mode (see <a class="el" href="classEigen_1_1SparseMatrix.html#a6400e6e733a7131f9b776d6386d2ed89">SparseMatrix::makeCompressed()</a>).</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classEigen_1_1SparseQR.html#a4b425ddb1358c914d764cde48853a4f6" title="Preprocessing step of a QR factorization.">analyzePattern()</a>, <a class="el" href="classEigen_1_1SparseQR.html#a55a34bacf05bd30a1dacbccad9f03c6d" title="Performs the numerical QR factorization of the input matrix.">factorize()</a> </dd></dl>

</div>
</div>
<a id="a55a34bacf05bd30a1dacbccad9f03c6d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a55a34bacf05bd30a1dacbccad9f03c6d">&#9670;&nbsp;</a></span>factorize()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType , typename OrderingType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classEigen_1_1SparseQR.html">Eigen::SparseQR</a>&lt; MatrixType, OrderingType &gt;::factorize </td>
          <td>(</td>
          <td class="paramtype">const MatrixType &amp;&#160;</td>
          <td class="paramname"><em>mat</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Performs the numerical QR factorization of the input matrix. </p>
<p>The function <a class="el" href="classEigen_1_1SparseQR.html#a4b425ddb1358c914d764cde48853a4f6" title="Preprocessing step of a QR factorization.">SparseQR::analyzePattern(const MatrixType&amp;)</a> must have been called beforehand with a matrix having the same sparsity pattern than <em>mat</em>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mat</td><td>The sparse column-major matrix </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ae9da700b8c3b9bb30ff77508c359e764"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae9da700b8c3b9bb30ff77508c359e764">&#9670;&nbsp;</a></span>info()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType_ , typename OrderingType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__enums.html#ga85fad7b87587764e5cf6b513a9e0ee5e">ComputationInfo</a> <a class="el" href="classEigen_1_1SparseQR.html">Eigen::SparseQR</a>&lt; MatrixType_, OrderingType_ &gt;::info </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Reports whether previous computation was successful. </p>
<dl class="section return"><dt>Returns</dt><dd><code>Success</code> if computation was successful, <code>NumericalIssue</code> if the QR factorization reports a numerical problem <code>InvalidInput</code> if the input matrix is invalid</dd></dl>
<dl class="section see"><dt>See also</dt><dd>iparm() <br  />
 </dd></dl>

</div>
</div>
<a id="ab9cc9c9d14e8c2f7587ca3f747bd1c14"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab9cc9c9d14e8c2f7587ca3f747bd1c14">&#9670;&nbsp;</a></span>lastErrorMessage()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType_ , typename OrderingType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::string <a class="el" href="classEigen_1_1SparseQR.html">Eigen::SparseQR</a>&lt; MatrixType_, OrderingType_ &gt;::lastErrorMessage </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>A string describing the type of error. This method is provided to ease debugging, not to handle errors. </dd></dl>

</div>
</div>
<a id="aa3c7967f81ef047891a549a514908cd3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa3c7967f81ef047891a549a514908cd3">&#9670;&nbsp;</a></span>matrixQ()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType_ , typename OrderingType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">SparseQRMatrixQReturnType&lt;<a class="el" href="classEigen_1_1SparseQR.html">SparseQR</a>&gt; <a class="el" href="classEigen_1_1SparseQR.html">Eigen::SparseQR</a>&lt; MatrixType_, OrderingType_ &gt;::matrixQ </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>an expression of the matrix Q as products of sparse Householder reflectors. The common usage of this function is to apply it to a dense matrix or vector <div class="fragment"><div class="line"><a class="code" href="group__matrixtypedefs.html#ga8554c6170729f01c7572574837ecf618">VectorXd</a> B1, B2;</div>
<div class="line"><span class="comment">// Initialize B1</span></div>
<div class="line">B2 = <a class="code" href="classEigen_1_1SparseQR.html#aa3c7967f81ef047891a549a514908cd3">matrixQ</a>() * B1;</div>
<div class="ttc" id="aclassEigen_1_1SparseQR_html_aa3c7967f81ef047891a549a514908cd3"><div class="ttname"><a href="classEigen_1_1SparseQR.html#aa3c7967f81ef047891a549a514908cd3">Eigen::SparseQR::matrixQ</a></div><div class="ttdeci">SparseQRMatrixQReturnType&lt; SparseQR &gt; matrixQ() const</div><div class="ttdef"><b>Definition:</b> SparseQR.h:188</div></div>
<div class="ttc" id="agroup__matrixtypedefs_html_ga8554c6170729f01c7572574837ecf618"><div class="ttname"><a href="group__matrixtypedefs.html#ga8554c6170729f01c7572574837ecf618">Eigen::VectorXd</a></div><div class="ttdeci">Matrix&lt; double, Dynamic, 1 &gt; VectorXd</div><div class="ttdoc">Dynamic×1 vector of type double.</div><div class="ttdef"><b>Definition:</b> Matrix.h:501</div></div>
</div><!-- fragment --></dd></dl>
<p>To get a plain <a class="el" href="classEigen_1_1SparseMatrix.html" title="A versatible sparse matrix representation.">SparseMatrix</a> representation of Q: </p><div class="fragment"><div class="line">SparseMatrix&lt;double&gt; Q;</div>
<div class="line">Q = SparseQR&lt;SparseMatrix&lt;double&gt; &gt;(A).<a class="code" href="classEigen_1_1SparseQR.html#aa3c7967f81ef047891a549a514908cd3">matrixQ</a>();</div>
</div><!-- fragment --><p> Internally, this call simply performs a sparse product between the matrix Q and a sparse identity matrix. However, due to the fact that the sparse reflectors are stored unsorted, two transpositions are needed to sort them before performing the product. </p>

</div>
</div>
<a id="a7764a1f00c0d83f6423f81a4a40d5f8c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7764a1f00c0d83f6423f81a4a40d5f8c">&#9670;&nbsp;</a></span>matrixR()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType_ , typename OrderingType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classEigen_1_1SparseMatrix.html">QRMatrixType</a>&amp; <a class="el" href="classEigen_1_1SparseQR.html">Eigen::SparseQR</a>&lt; MatrixType_, OrderingType_ &gt;::matrixR </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>a const reference to the <b>sparse</b> upper triangular matrix R of the QR factorization. </dd></dl>
<dl class="section warning"><dt>Warning</dt><dd>The entries of the returned matrix are not sorted. This means that using it in algorithms expecting sorted entries will fail. This include random coefficient accesses (SpaseMatrix::coeff()), and coefficient-wise operations. <a class="el" href="classEigen_1_1Matrix.html" title="The matrix class, also used for vectors and row-vectors.">Matrix</a> products and triangular solves are fine though.</dd></dl>
<p>To sort the entries, you can assign it to a row-major matrix, and if a column-major matrix is required, you can copy it again: </p><div class="fragment"><div class="line">SparseMatrix&lt;double&gt;          R  = qr.matrixR();  <span class="comment">// column-major, not sorted!</span></div>
<div class="line">SparseMatrix&lt;double,RowMajor&gt; Rr = qr.matrixR();  <span class="comment">// row-major, sorted</span></div>
<div class="line">SparseMatrix&lt;double&gt;          Rc = Rr;            <span class="comment">// column-major, sorted</span></div>
</div><!-- fragment --> 
</div>
</div>
<a id="afa0359921bffa067601b102edff440b0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afa0359921bffa067601b102edff440b0">&#9670;&nbsp;</a></span>rank()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType_ , typename OrderingType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> <a class="el" href="classEigen_1_1SparseQR.html">Eigen::SparseQR</a>&lt; MatrixType_, OrderingType_ &gt;::rank </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>the number of non linearly dependent columns as determined by the pivoting threshold.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classEigen_1_1SparseQR.html#a05f11a211307cb106e9e47ee9730d7ed">setPivotThreshold()</a> </dd></dl>

</div>
</div>
<a id="a9b196c075fdf32737b6843a615e79ea6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9b196c075fdf32737b6843a615e79ea6">&#9670;&nbsp;</a></span>rows()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType_ , typename OrderingType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> <a class="el" href="classEigen_1_1SparseQR.html">Eigen::SparseQR</a>&lt; MatrixType_, OrderingType_ &gt;::rows </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>the number of rows of the represented matrix. </dd></dl>

</div>
</div>
<a id="a05f11a211307cb106e9e47ee9730d7ed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a05f11a211307cb106e9e47ee9730d7ed">&#9670;&nbsp;</a></span>setPivotThreshold()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType_ , typename OrderingType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classEigen_1_1SparseQR.html">Eigen::SparseQR</a>&lt; MatrixType_, OrderingType_ &gt;::setPivotThreshold </td>
          <td>(</td>
          <td class="paramtype">const RealScalar &amp;&#160;</td>
          <td class="paramname"><em>threshold</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Sets the threshold that is used to determine linearly dependent columns during the factorization.</p>
<p>In practice, if during the factorization the norm of the column that has to be eliminated is below this threshold, then the entire column is treated as zero, and it is moved at the end. </p>

</div>
</div>
<a id="aa77f5cb833bbea615adb532139761971"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa77f5cb833bbea615adb532139761971">&#9670;&nbsp;</a></span>solve()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType_ , typename OrderingType_ &gt; </div>
<div class="memtemplate">
template&lt;typename Rhs &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classEigen_1_1Solve.html">Solve</a>&lt;<a class="el" href="classEigen_1_1SparseQR.html">SparseQR</a>, Rhs&gt; <a class="el" href="classEigen_1_1SparseQR.html">Eigen::SparseQR</a>&lt; MatrixType_, OrderingType_ &gt;::solve </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classEigen_1_1MatrixBase.html">MatrixBase</a>&lt; Rhs &gt; &amp;&#160;</td>
          <td class="paramname"><em>B</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>the solution X of \( A X = B \) using the current decomposition of A.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classEigen_1_1SparseQR.html#aba8ae81fd3d4ce9139eccb6b7a0256b2">compute()</a> </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="SparseQR_8h_source.html">SparseQR.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespaceEigen.html">Eigen</a></li><li class="navelem"><a class="el" href="classEigen_1_1SparseQR.html">SparseQR</a></li>
    <li class="footer">Generated on Thu Apr 21 2022 13:07:56 for Eigen by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
